/**
 * https://codeforces.com/contest/1999/problem/C
 */

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
	int t;
	cin>>t;
	while(t--){
		ll n,s,m;
		cin>>n>>s>>m;
		ll t=0;
		int h=1;
		while(n--){
			ll a,b;
			cin>>a>>b;
			if(h&&a-t>=s){
				cout<<"YES"<<endl;
				h=0;
			}
			else
			t=b;
		}
		if(h&&m-t>=s)
		cout<<"YES"<<endl;
		else if(h)
		cout<<"NO"<<endl;
	}
	return 0;
}